

/**
 * 
 * @author danielshalev
 *
 */
public class Basher extends ComputerControlled {
	/**
	 * constructor
	 */
	public Basher(){
		super();
	}
	
	
	@Override
	public void doAction(SpaceWars game) {
		//the moving action of this turn
		this.goAfterSpaceShip(game);
		
		//the shield is off in default every round
		this.turnShieldOff();
		
		//if the closest ship distance is less then 0.2 turn the shield on
		if(game.getClosestShipTo(this).getPhysics().distanceFrom(this.getPhysics())<=CLOSEST_SHIP_CONDITION){
			turnShieldOn();
		}
		//the ship is regaining energy every round
		this.setEnergy(REGAINED_ENERGY);
	
	}
	
}
